#pragma once

#include "Tool.h"

class PanView;

class PanTool : public Tool
{
	DECLARE_DYNCREATE(PanTool)

// Attributes
private:	
	PanView &	m_Owner;

	HCURSOR			m_CursorHand;
	HCURSOR			m_CursorHandDrag;

	CPoint			m_Start;
	CPoint			m_Old;

	bool			m_Panning;
// Operations
public:

	virtual void Show();
	virtual void Hide();

	virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	virtual void OnLButtonDown(UINT nFlags, CPoint p);
	virtual void OnLButtonUp(UINT nFlags, CPoint p);
	virtual void OnMouseMove(UINT nFlags, CPoint p);
	virtual bool OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);

public:
	PanTool(PanView & owner); 

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(PanTool)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~PanTool();

	// Generated message map functions
	//{{AFX_MSG(PanTool)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
